def sortub(x,y):
    a=string.split(x, '_')
    xday=a[0][2:4]
    xmonth=a[0][4:7]
    xyear=a[0][7:11]
    time=string.split(a[1],'.')
    xampm=time[0][-2:]
    xsecs=time[0][-4:-2]
    xmins=time[0][-6:-4]
    xhour=time[0][:-6]

    a=string.split(y, '_')
    yday=a[0][2:4]
    ymonth=a[0][4:7]
    yyear=a[0][7:11]
    time=string.split(a[1],'.')
    yampm=time[0][-2:]
    ysecs=time[0][-4:-2]
    ymins=time[0][-6:-4]
    yhour=time[0][:-6]

    months=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
    xmnth_index=months.index(string.lower(xmonth))
    ymnth_index=months.index(string.lower(ymonth))

    if float(xyear) = float(yyear):
        if xmnth_index = ymnth_index:
            if float(xday) = float(yday):
                if xampm = yampm:
                    if float(xhour) = float(yhour):
                        if float(xmins) = float(ymins):
                            if float(xsecs) = float(ysecs):
                                retval = 0
                            elif float(xsecs) < float(ysecs):
                                retval = -1
                            else:
                                retval = 1
                        elif float(xmins) < float(ymins):
                            retval = -1
                        else:
                            retval = 1
                    elif float(xhour) < float(yhour):
                        retval = -1
                    else:
                        retval = 1
                elif string.lower(xampm) = 'am':
                    retval = -1
                else:
                    retval = 1
            elif float(xday) < float(yday):
                retval = -1
            else:
                retval = 1
        elif xmnth_index < ymnth_index:
            retval = -1
        else:
            retval = 1
    elif float(xyear) < float(yyear):
        retval = -1
    else:
        retval = 1
    if float(xyear) < float(yyear):
        retval=-1
    elif xmnth < ymnth:
        retval=-1

    return retval   